Tabs Gone Wild

I'm using some custom export to excel stuff, and when I paste object text that has tabs and linefeeds in it, my export gets screwy. Here's a code snippet:

currMod = current Module
Object othero
Buffer tempO = create
for othero in entire currMod do
{
string oi = identifier othero ""
string ot = othero."Object Text" ""
tempO += oi "\t" ot
tempO += "\n"
}
OleAutoObj wbs 
OleAutoObj wb
OleAutoObj ws
OleAutoObj objCell
OleAutoArgs args = create
OleAutoObj objFont
void openExcel()
{
    OleAutoObj ex = oleCreateAutoObject "Excel.Application"
        oleGet (ex, "Workbooks", wbs) 
        oleMethod (wbs, "Add", args, wb)
        olePut(ex, "Visible", true)
        put(args, 1)
        oleGet (ex, "Worksheets", args, ws)
}
void pasteString (int y, int x, string s)
{
        clear args
        put (args, y)
        put (args, x)
        oleGet (ws, "Cells", args, objCell)
        clear args
        put (args, objCell)
        copyToClipboard s
        print oleMethod (ws, "Paste",args)
}
openExcel() 
pasteString (1,1, tempStringOf tempO)
delete tempO
}


Pasting pukes if there is a linefeed or tab in it. How can I ignore these tabs and linefeeds during pasting, but still have them appear in a cell after pasting?


moheganburnerIII - Fri Oct 14 17:03:02 EDT 2011

Re: Tabs Gone Wild
Mathias Mamsch - Sat Oct 15 08:42:34 EDT 2011

See here:

https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14627116&#14627116

Hope this helps, regards, Mathias

Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Re: Tabs Gone Wild
moheganburnerIII - Sat Oct 15 17:50:59 EDT 2011

Thanks.